package de.andreavicentini.teatralia.pages.events;

import java.util.Locale;

import org.magiclabs.htmlx.ProgrammaticTextStructure;
import org.magiclabs.htmlx.TextStructure;


public class LocationLink {

	private final Location location;

	private enum Keys implements TextStructure.TextKey {
		map;
	}
	
	private final static TextStructure TOKENS = new ProgrammaticTextStructure() {{
		this.add(Keys.map)
			.add(Locale.GERMAN, "Mappe")
			.add(Locale.ITALIAN, "mappa")
			;
	}};
	
	public LocationLink(Location location) {
		this.location = location;
	}
	
	@Override
	public String toString() {
		return this.location.getAdresse() + " (<a target=_new href=\"" + this.location.getUrl() + "\"><em>" + TOKENS.get(Keys.map) + "</em></a>)";
	}
}
